<#import "./layout/layout.ftl" as layout>
<@layout.page menu='review'>

<p class="right-top-subContent"><a href="javascript:void(0);" onclick="pageSkip.goToMyHdj();">管理中心</a>&nbsp;&nbsp;/&nbsp;&nbsp;<a href="javascript:void(0);" onclick="pageSkip.goToTicketList();">票券审核</a></p>
<!--底部区域-->
<div class="right-bottom-content" id="right-bottom-content">
  <div class="activity-options">
    <div class="activity-left-opts">
      <span class="activity-simple selected">报名审核</span>
      <span class="activity-ticket">退票审核</span>
    </div>
  </div>
  <div class="activity-project activity-content-0" style="margin-bottom:0;">
    <div class="t-search-box">
      <div class="t-search-1">
        <select id="join_activity_select" name="activity_id">
          <option value="" class="">全部活动</option>
        </select>
      </div>
      <div class="t-search-2">
        <select id="join_search_condition" name="search_type">
          <option value="phone">手机号码</option>
          <option value="name">用户姓名</option>
        </select>
        <input id="join_search_value" name="" type="text" placeholder="请输入要搜索的内容">
      </div>
      <div class="t-search-3">
        <input id="join_search_date_start" type="text" placeholder="不限时间">
        <i class="fa fa-caret-down fa-down1 fa-lg pointer" onclick="arrowClick(this);"></i>
        <input id="join_search_date_end" type="text" placeholder="不限时间" style="border-left: 1px solid #dedede">
        <i class="fa fa-caret-down fa-down2 fa-lg pointer" onclick="arrowClick(this);"></i>
        <span class="pointer" onclick="ticketList.joinThreeDays(this);">近三天</span>
        <span class="pointer" onclick="ticketList.joinSevenDays(this);">近七天</span>
      </div>
      <div class="t-search-4">
        <button class="btn-f66926" onclick="ticket.getJoinList();">搜索</button>
        <button class="f66926" onclick="ticketList.reSet();">重置</button>
      </div>
    </div>
    <div class="t-content-box">
      <div class="t-content-top">
        <div>
          <div class="t-content-top-left">
            <span>共找到</span>
            <span id="join_count">0</span>
            <span>条结果</span>
          </div>
          <div class="t-content-top-right">
            <button class="batch-agree" onclick="ticket.batchJoinAgreeOpt()">批量同意</button>
            <button class="batch-refuse" onclick="ticket.batchJoinRejectOpt()">批量拒绝</button>
          </div>
          <div style="clear: both;"></div>
        </div>
      </div>
      <div class="t-table-box">
        <!--表格头部-->
        <div class="t-th">
          <div class="td-activity-name">
            <!--<span data-selected="0" class="fa fa-square-o fa-2x"></span>-->
            <input name="checkAll" type="checkbox" onclick="ticketList.joinSelectedAll(this.checked)">
            <span>活动名称</span>
          </div>
          <div class="td-ticket-name">票名</div>
          <div class="td-status">状态</div>
          <div class="td-nick-name">账号昵称</div>
          <div class="td-user-name">姓名</div>
          <div class="td-phone-number">手机</div>
          <div id="join_order_paytime" class="td-ticket-time" data-order-key="pay_time" data-order-value="1" onclick="ticket.orderList(this, &#39;join&#39;);">
            <span class="hover-f66926">购票时间</span>
            <span class="fa fa-caret-down f66926 pointer"></span>
          </div>
          <div class="td-ticket-detail">详情</div>
          <div class="td-btns">操作</div>
        </div>
        <div id="join_list">
          <div class="no-data-box"><img class="no-data-img" src="./活动聚 - 票券审核_files/no-data.png" alt="这是图片">
            <p class="no-data-title">这里什么也没有</p></div>
        </div>
      </div>
      <div>
        <div class="M-box" id="join_page" style="width: auto; float: right; display: none;"></div>
        <div style="clear: both"></div>
      </div>
    </div>

  </div>

  <div class="activity-project activity-content-1" style="margin-bottom:0;">
    <div class="t-search-box">
      <div class="t-search-1">
        <select id="refund_activity_select" name="activity_id">
          <option value="">全部活动</option>
        </select>
      </div>
      <div class="t-search-2">
        <select id="refund_search_condition" name="search_type">
          <option value="phone">手机号码</option>
          <option value="name">用户姓名</option>
        </select>
        <input id="refund_search_value" name="" type="text" placeholder="请输入要搜索的内容">
      </div>
      <div class="t-search-3">
        <input id="refund_search_date_start" type="text" placeholder="不限时间">
        <i class="fa fa-caret-down fa-down1 fa-lg pointer" onclick="arrowClick(this);"></i>
        <input id="refund_search_date_end" type="text" placeholder="不限时间" style="border-left: 1px solid #dedede">
        <i class="fa fa-caret-down fa-down2 fa-lg pointer" onclick="arrowClick(this);"></i>
        <span class="pointer" onclick="ticketList.refundThreeDays(this);">近三天</span>
        <span class="pointer" onclick="ticketList.refundSevenDays(this);">近七天</span>
      </div>
      <div class="t-search-4">
        <button class="btn-f66926" onclick="ticket.getAllRefundList();">搜索</button>
        <button class="f66926" onclick="ticketList.reSet();">重置</button>
      </div>
    </div>
    <div class="t-content-box">
      <div class="t-content-top">
        <div>
          <div class="t-content-top-left">
            <span>共找到</span>
            <span id="refund_count">0</span>
            <span>条结果</span>
          </div>
          <div class="t-content-top-right">
            <button class="batch-agree" onclick="ticket.batchRefundAgreeOpt()">批量同意</button>
            <button class="batch-refuse" onclick="ticket.batchRefundRejectOpt()">批量拒绝</button>
          </div>
          <div style="clear: both;"></div>
        </div>
      </div>
      <div class="t-table-box">
        <!--表格头部-->
        <div class="t-th">
          <div class="td-activity-name">
            <input name="checkAll" type="checkbox" onclick="ticketList.refundSelectedAll(this.checked)">
            <span>活动名称</span>
          </div>
          <div class="td-ticket-name">票名</div>
          <div class="td-status">状态</div>
          <div class="td-nick-name">账号昵称</div>
          <div class="td-user-name">姓名</div>
          <div class="td-phone-number">手机</div>
          <div class="td-ticket-time" id="refund_order_paytime" data-order-key="pay_time" data-order-value="1" onclick="ticket.orderList(this, &#39;refund&#39;);">
            <span class="hover-f66926">购票时间</span>
            <span class="fa fa-caret-down f66926 pointer"></span>
          </div>
          <div class="td-ticket-detail">详情</div>
          <div class="td-btns">操作</div>
        </div>
        <div id="refund_list">
        </div>
      </div>
      <div>
        <div class="M-box" id="refund_page" style="width: auto;float: right"></div>
        <div style="clear: both;"></div>
      </div>
    </div>
  </div>
</div>

<!--layer 批量拒绝报名弹窗-->
<div class="lay-refuse-box lay-refuse-box-1 none">
  <p class="refuse-batch-p">
    <span style="color: #F7BA2A;" class="fa fa-exclamation-circle fa-lg"></span>
    <span>您将拒绝选择的</span>
    <span id="refuse_select_num"></span>
    <span>记录报名，该操作不可恢复，请谨慎操作。</span>
  </p>
  <div class="lay-refuse-content">
    <div class="lay-refuse-2">
                <span>
                    <input type="radio" name="refuse_reason_1" value="1" checked="">
                </span>
      <span>抱歉，活动满员了</span>
    </div>
    <div class="lay-refuse-2">
                <span>
                    <input type="radio" name="refuse_reason_1" value="2">
                </span>
      <span>与活动设置的参加资格不符</span>
    </div>
    <div class="lay-refuse-2">
                <span>
                    <input type="radio" name="refuse_reason_1" value="3">
                </span>
      <span>填写的报名信息不真实</span>
    </div>
    <div class="lay-refuse-2">
                <span>
                    <input type="radio" name="refuse_reason_1" value="4">
                </span>
      <span>计划有变，活动暂停</span>
    </div>
    <div class="lay-refuse-1">
                <span style="float: left">
                    <input type="radio" name="refuse_reason_1" value="0">
                </span>
      <textarea name="" id="refuse_textarea_1" cols="30" rows="10" placeholder="请输入拒绝原因"></textarea>
    </div>
  </div>
</div>

<!--layer 单个拒绝报名弹窗-->
<div class="lay-refuse-box lay-refuse-box-2 none">
  <div style="margin-top: 15px" class="lay-refuse-content">
    <div class="lay-refuse-2">
                <span>
                    <input type="radio" name="refuse_reason_2" value="1" checked="">
                </span>
      <span>抱歉，活动满员了</span>
    </div>
    <div class="lay-refuse-2">
                <span>
                    <input type="radio" name="refuse_reason_2" value="2">
                </span>
      <span>与活动设置的参加资格不符</span>
    </div>
    <div class="lay-refuse-2">
                <span>
                    <input type="radio" name="refuse_reason_2" value="3">
                </span>
      <span>填写的报名信息不真实</span>
    </div>
    <div class="lay-refuse-2">
                <span>
                    <input type="radio" name="refuse_reason_2" value="4">
                </span>
      <span>计划有变，活动暂停</span>
    </div>
    <div class="lay-refuse-1">
                <span style="float: left">
                    <input type="radio" name="refuse_reason_2" value="0">
                </span>
      <textarea id="refuse_textarea_2" cols="30" rows="10" placeholder="请输入拒绝原因"></textarea>
    </div>
  </div>
</div>

<!--layer 批量拒绝退款弹窗-->
<div class="lay-refuse-box lay-refuse-box-1-b none">
  <p class="refuse-batch-p">
    <span style="color: #F7BA2A;" class="fa fa-exclamation-circle fa-lg"></span>
    <span>您将拒绝选择的</span>
    <span id="refuse-batch-number"></span>
    <span>条记录报名，该操作不可恢复，请谨慎操作。</span>
  </p>
  <div class="lay-refuse-content">
    <div class="lay-refuse-2">
                <span>
                    <input type="radio" name="refuse_reason_4" value="1" checked="">
                </span>
      <span>一旦售出，不可退款</span>
    </div>
    <div class="lay-refuse-2">
                <span>
                    <input type="radio" name="refuse_reason_4" value="2">
                </span>
      <span>超过可退款时间</span>
    </div>
    <div class="lay-refuse-2">
                <span>
                    <input type="radio" name="refuse_reason_4" value="3">
                </span>
      <span>已线下退款</span>
    </div>
    <div class="lay-refuse-1">
                <span style="float: left">
                    <input type="radio" name="refuse_reason_4" value="0">
                </span>
      <textarea name="" id="refuse_textarea_4" cols="30" rows="10" placeholder="请输入拒绝原因"></textarea>
    </div>
  </div>
</div>

<!--layer 单个拒绝退款弹窗-->
<div class="lay-refuse-box lay-refuse-box-2-b none">
  <div style="margin-top: 15px" class="lay-refuse-content">

    <div class="lay-refuse-2">
                <span>
                    <input type="radio" name="refuse_reason_3" value="1" checked="">
                </span>
      <span>一旦售出，不可退款</span>
    </div>
    <div class="lay-refuse-2">
                <span>
                    <input type="radio" name="refuse_reason_3" value="2">
                </span>
      <span>超过可退款时间</span>
    </div>
    <div class="lay-refuse-2">
                <span>
                    <input type="radio" name="refuse_reason_3" value="3">
                </span>
      <span>已线下退款</span>
    </div>
    <div class="lay-refuse-1">
                <span style="float: left">
                    <input type="radio" name="refuse_reason_3" value="0">
                </span>
      <textarea id="refuse_textarea_3" cols="30" rows="10" placeholder="请输入拒绝原因"></textarea>
    </div>
  </div>
</div>

<script>
  $('#join_page').pagination({
    pageCount: "0",
    coping:true,
    homePage: '首页',
    endPage: '末页',
    callback:function(page){
      ticket.getJoinList(page);
      //取消全选
      ticket.cancelSelect();
    }
  }, function(page){
    ticket.joinPage = page;
    ticket.getJoinList(page);
  });
  $('#refund_page').pagination({
    pageCount: "",
    coping:true,
    homePage: '首页',
    endPage: '末页',
    callback:function(page){
      ticket.getAllRefundList(page);
      //取消全选
      ticket.cancelSelect();
    }
  }, function(page){
    ticket.refundPage = page;
  });

  template.defaults.imports.dateFormat = function(timestamp){
    var date = new Date(timestamp * 1000);
    return date.toLocaleString();
  };
</script><div class="layui-layer-move"></div>
<script type="text/html" id="ticket_join_item">
  <div class="t-tr" data-value="{{id}}">
    <div class="td-activity-name">
      <input name="join_checkbox_select" type="checkbox" value="{{id}}">
      <span title="{{title}}">{{title}}</span>
    </div>
    <div class="td-ticket-name" title="{{ticket_type_name}}">{{ticket_type_name}}</div>
    <div class="td-status">
      {{ if (status == 0) }}
      <span class="td-status-orange">审核中</span>{{ else if(status == 1) }}
      <span class="td-status-green">有效</span>{{ else if(status == 2) }}
      <span class="td-status-grey">已使用</span>{{ else if(status == 3) }}
      <span class="td-status-grey">审核拒绝</span>{{ else if(status == 4) }}
      <span class="td-status-orange">退票中</span>{{ else if(status == 5) }}
      <span class="td-status-grey">已退票</span>{{ else if(status == 6) }}
      <span class="td-status-grey">自动验票</span>
      {{/if}}
    </div>
    <div class="td-nick-name">{{nick}}</div>
    <div class="td-user-name">{{name}}</div>
    <div class="td-phone-number">{{phone}}</div>
    <div class="td-ticket-time">{{pay_time}}</div>
    <div class="td-ticket-detail hover-f66926">
      <span data-open="0" onclick="ticket.getPersonDetail(this, '{{aid}}', '{{id}}');">查看</span>
      <span class="fa fa-caret-down f66926" onclick="arrowClick(this);"></span>
    </div>
    <div class="td-btns">
      <button class="agree-btn" onclick="ticket.activityJoinOpt(this, '{{aid}}', '{{id}}', '1', '');">同意</button>
      <button class="refuse-btn" onclick="ticket.rejectJoinDialog(this, '{{aid}}', '{{id}}');">拒绝</button>
    </div>
  </div>
</script>
<script type="text/html" id="ticket_refund_item">
  <div class="t-tr" data-value="{{id}}">
    <div class="td-activity-name">
      <input name="refund_checkbox_select" type="checkbox" value="{{id}}">
      <span title="{{title}}">{{title}}</span>
    </div>
    <div class="td-ticket-name" title="{{ticket_type_name}}">{{ticket_type_name}}</div>
    <div class="td-status">
      {{ if(status == 0) }}
      <span class="td-status-orange">审核中</span>{{ else if(status == 1) }}
      <span class="td-status-green">有效</span>{{ else if(status == 2) }}
      <span class="td-status-grey">已使用</span>{{ else if(status == 3) }}
      <span class="td-status-grey">审核拒绝</span>{{ else if(status == 4) }}
      <span class="td-status-orange">退票中</span>{{ else if(status == 5) }}
      <span class="td-status-grey">已退票</span>{{ else if(status == 6) }}
      <span class="td-status-grey">自动验票</span>
      {{ /if }}
    </div>
    <div class="td-nick-name">{{nick}}</div>
    <div class="td-user-name">{{name}}</div>
    <div class="td-phone-number">{{phone}}</div>
    <div class="td-ticket-time">{{pay_time}}</div>
    <div class="td-ticket-detail hover-f66926">
      <span data-open="0" onclick="ticket.getPersonDetail(this, '{{aid}}', '{{id}}');">查看</span>
      <span class="fa fa-caret-down f66926" onclick="arrowClick(this);"></span>
    </div>
    <div class="td-btns">
      <button class="agree-btn" onclick="ticket.toRefundTicket(this, '{{aid}}', '{{id}}', '1', '');">同意</button>
      <button class="refuse-btn" onclick="ticket.rejectRefundDialog(this, '{{aid}}', '{{id}}');">拒绝</button>
    </div>
  </div>
</script>
<script type="text/html" id="ticket_detail">
  <div class="t-detail-box">
    <div class="t-detail-left">
      <p>报名信息</p>
      <div class="t-user-detail-box">
        {{ each infos }}
        <div class="t-user-detail-div">
          <span>{{infos[$index].l}}：</span>
          <span>{{infos[$index].v}}</span>
        </div>
        {{ /each }}
      </div>
    </div>
    <div class="t-detail-right">
      <p>状态记录</p>
      {{ each notices }}
      <div class="t-status-div">
        <p class="f66926">
          <span class="fa fa-volume-up fa-2x"></span>
          <span class="t-status-div-type">{{notices[$index].title}}</span>
          <span class="t-status-div-time">{{notices[$index].time | dateFormat}}</span>
        </p>
        {{ if(notices[$index].content != '') }}
        <p>
          <span>{{ notices[$index].content }}</span>
        </p>
        {{ /if }}
      </div>
      {{ /each }}
    </div>
  </div>
</script>
<script type="text/javascript" src="../../data/mgt/stats" charset="UTF-8"></script>
<script src="../../js/mgt/common/jquery.datetimepicker.full.min.js"></script>
</@layout.page>